import request from "@/utils/request";
import mockRequest from '@/utils/mockRequest'

// 删除购物车商品
export const reqDeleteCart = (skuId)=>{
    return request.delete(`/cart/deleteCart/${skuId}`)
}

// 修改商品选中状态
export const reqCheckCart = (skuId,isChecked)=>{
    return request.get(`/cart/checkCart/${skuId}/${isChecked}`)
}

// 获取购物车列表
export const reqCartList = ()=>{
    return request.get(`cart/cartList`)
}

// 添加购物车
export const reqToCart = (skuId,skuNum) =>{
    return request.post(`/cart/addToCart/${skuId}/${skuNum}`)
}

// 商品详情
export const reqGoodsDetail = (skuId)=>{
    return request.get(`/item/${skuId}`);
}
// 搜索页的商品列表接口
export const reqGoodsList = (data = {})=>{
    return request.post('/list',data)
}
// 三级列表的请求
export const reqCategoryList = () =>{
    return request.get('/product/getBaseCategoryList')
}
// 自己写的轮播图请求
export const reqBannerList = () =>{
    return mockRequest.get('/getBannerList')
}
// 这是小轮播图的请求
export const reqFloorList = () =>{
    return mockRequest.get('/getFloorList')
}